package com.sky.lightleafpicturepavilionserver.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 壁纸表
 * @TableName wallpaper
 */
@TableName(value ="wallpaper")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Wallpaper implements Serializable {
    /**
     * 壁纸ID，主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 壁纸标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 壁纸描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 分类ID
     */
    @TableField(value = "category_id")
    private Long categoryId;

    /**
     * 专辑ID
     */
    @TableField(value = "album_id")
    private Long albumId;

    /**
     * 主题套装ID
     */
    @TableField(value = "theme_set_id")
    private Long themeSetId;

    /**
     * 缩略图URL
     */
    @TableField(value = "thumbnail_url")
    private String thumbnailUrl;

    /**
     * 原图URL
     */
    @TableField(value = "original_url")
    private String originalUrl;

    /**
     * 高清图URL
     */
    @TableField(value = "hd_url")
    private String hdUrl;

    /**
     * 图片宽度
     */
    @TableField(value = "width")
    private Integer width;

    /**
     * 图片高度
     */
    @TableField(value = "height")
    private Integer height;

    /**
     * 文件大小（字节）
     */
    @TableField(value = "file_size")
    private Long fileSize;

    /**
     * 图片格式：jpg、png、webp等
     */
    @TableField(value = "format")
    private String format;

    /**
     * 设备类型：1-手机，2-平板，3-电脑，4-通用
     */
    @TableField(value = "device_type")
    private Integer deviceType;

    /**
     * 质感等级：1-普通，2-高级质感
     */
    @TableField(value = "quality_level")
    private Integer qualityLevel;

    /**
     * 标签，多个标签用逗号分隔
     */
    @TableField(value = "tags")
    private String tags;

    /**
     * 作者
     */
    @TableField(value = "author")
    private String author;

    /**
     * 来源
     */
    @TableField(value = "source")
    private String source;

    /**
     * 浏览次数
     */
    @TableField(value = "view_count")
    private Integer viewCount;

    /**
     * 下载次数
     */
    @TableField(value = "download_count")
    private Integer downloadCount;

    /**
     * 点赞次数
     */
    @TableField(value = "like_count")
    private Integer likeCount;

    /**
     * 收藏次数
     */
    @TableField(value = "collect_count")
    private Integer collectCount;

    /**
     * 下载所需能量
     */
    @TableField(value = "energy_cost")
    private Integer energyCost;

    /**
     * 是否热门：0-否，1-是
     */
    @TableField(value = "is_hot")
    private Integer isHot;

    /**
     * 热门评分
     */
    @TableField(value = "hot_score")
    private BigDecimal hotScore;

    /**
     * 排序权重
     */
    @TableField(value = "sort_order")
    private Integer sortOrder;

    /**
     * 状态：0-禁用，1-启用
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Wallpaper other = (Wallpaper) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getAlbumId() == null ? other.getAlbumId() == null : this.getAlbumId().equals(other.getAlbumId()))
            && (this.getThemeSetId() == null ? other.getThemeSetId() == null : this.getThemeSetId().equals(other.getThemeSetId()))
            && (this.getThumbnailUrl() == null ? other.getThumbnailUrl() == null : this.getThumbnailUrl().equals(other.getThumbnailUrl()))
            && (this.getOriginalUrl() == null ? other.getOriginalUrl() == null : this.getOriginalUrl().equals(other.getOriginalUrl()))
            && (this.getHdUrl() == null ? other.getHdUrl() == null : this.getHdUrl().equals(other.getHdUrl()))
            && (this.getWidth() == null ? other.getWidth() == null : this.getWidth().equals(other.getWidth()))
            && (this.getHeight() == null ? other.getHeight() == null : this.getHeight().equals(other.getHeight()))
            && (this.getFileSize() == null ? other.getFileSize() == null : this.getFileSize().equals(other.getFileSize()))
            && (this.getFormat() == null ? other.getFormat() == null : this.getFormat().equals(other.getFormat()))
            && (this.getDeviceType() == null ? other.getDeviceType() == null : this.getDeviceType().equals(other.getDeviceType()))
            && (this.getQualityLevel() == null ? other.getQualityLevel() == null : this.getQualityLevel().equals(other.getQualityLevel()))
            && (this.getTags() == null ? other.getTags() == null : this.getTags().equals(other.getTags()))
            && (this.getAuthor() == null ? other.getAuthor() == null : this.getAuthor().equals(other.getAuthor()))
            && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
            && (this.getViewCount() == null ? other.getViewCount() == null : this.getViewCount().equals(other.getViewCount()))
            && (this.getDownloadCount() == null ? other.getDownloadCount() == null : this.getDownloadCount().equals(other.getDownloadCount()))
            && (this.getLikeCount() == null ? other.getLikeCount() == null : this.getLikeCount().equals(other.getLikeCount()))
            && (this.getCollectCount() == null ? other.getCollectCount() == null : this.getCollectCount().equals(other.getCollectCount()))
            && (this.getEnergyCost() == null ? other.getEnergyCost() == null : this.getEnergyCost().equals(other.getEnergyCost()))
            && (this.getIsHot() == null ? other.getIsHot() == null : this.getIsHot().equals(other.getIsHot()))
            && (this.getHotScore() == null ? other.getHotScore() == null : this.getHotScore().equals(other.getHotScore()))
            && (this.getSortOrder() == null ? other.getSortOrder() == null : this.getSortOrder().equals(other.getSortOrder()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getAlbumId() == null) ? 0 : getAlbumId().hashCode());
        result = prime * result + ((getThemeSetId() == null) ? 0 : getThemeSetId().hashCode());
        result = prime * result + ((getThumbnailUrl() == null) ? 0 : getThumbnailUrl().hashCode());
        result = prime * result + ((getOriginalUrl() == null) ? 0 : getOriginalUrl().hashCode());
        result = prime * result + ((getHdUrl() == null) ? 0 : getHdUrl().hashCode());
        result = prime * result + ((getWidth() == null) ? 0 : getWidth().hashCode());
        result = prime * result + ((getHeight() == null) ? 0 : getHeight().hashCode());
        result = prime * result + ((getFileSize() == null) ? 0 : getFileSize().hashCode());
        result = prime * result + ((getFormat() == null) ? 0 : getFormat().hashCode());
        result = prime * result + ((getDeviceType() == null) ? 0 : getDeviceType().hashCode());
        result = prime * result + ((getQualityLevel() == null) ? 0 : getQualityLevel().hashCode());
        result = prime * result + ((getTags() == null) ? 0 : getTags().hashCode());
        result = prime * result + ((getAuthor() == null) ? 0 : getAuthor().hashCode());
        result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
        result = prime * result + ((getViewCount() == null) ? 0 : getViewCount().hashCode());
        result = prime * result + ((getDownloadCount() == null) ? 0 : getDownloadCount().hashCode());
        result = prime * result + ((getLikeCount() == null) ? 0 : getLikeCount().hashCode());
        result = prime * result + ((getCollectCount() == null) ? 0 : getCollectCount().hashCode());
        result = prime * result + ((getEnergyCost() == null) ? 0 : getEnergyCost().hashCode());
        result = prime * result + ((getIsHot() == null) ? 0 : getIsHot().hashCode());
        result = prime * result + ((getHotScore() == null) ? 0 : getHotScore().hashCode());
        result = prime * result + ((getSortOrder() == null) ? 0 : getSortOrder().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        return getClass().getSimpleName() +
                " [" +
                "Hash = " + hashCode() +
                ", id=" + id +
                ", title=" + title +
                ", description=" + description +
                ", categoryId=" + categoryId +
                ", albumId=" + albumId +
                ", themeSetId=" + themeSetId +
                ", thumbnailUrl=" + thumbnailUrl +
                ", originalUrl=" + originalUrl +
                ", hdUrl=" + hdUrl +
                ", width=" + width +
                ", height=" + height +
                ", fileSize=" + fileSize +
                ", format=" + format +
                ", deviceType=" + deviceType +
                ", qualityLevel=" + qualityLevel +
                ", tags=" + tags +
                ", author=" + author +
                ", source=" + source +
                ", viewCount=" + viewCount +
                ", downloadCount=" + downloadCount +
                ", likeCount=" + likeCount +
                ", collectCount=" + collectCount +
                ", energyCost=" + energyCost +
                ", isHot=" + isHot +
                ", hotScore=" + hotScore +
                ", sortOrder=" + sortOrder +
                ", status=" + status +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", serialVersionUID=" + serialVersionUID +
                "]";
    }
}